import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/css/index.scss';
// 接口拦截
import interceptors from './api/interceptors';
//字体icon
import '@/assets/icon/iconfont.css';
interceptors();
//加载消息通知组件
import components from '@/components/NewMessage.vue';
//加载主菜单
import MainMenu from '@/components/MainMenu.vue';
import common from './config/common';
// 时间处理工具函数
import moment from 'moment';
import * as echarts from 'echarts';
import * as filters from './filters/index'


Vue.component('NewMessage', components);
Vue.component('MainMenu', MainMenu);
Vue.config.productionTip = false;
//引用公共方法，加载在作用域上
Vue.prototype.common = common;
Vue.prototype.$moment = moment;
Vue.prototype.$echarts = echarts;
Vue.use(ElementUI);
Vue.use(MainMenu);

window.eventBus = new Vue();

//全局过滤器
Object.keys(filters).forEach(key=>{
	Vue.filter(key,filters[key])
})

new Vue({
  router,
  store,
  render: (h) => h(App)
}).$mount('#app');
// document.getElementById("newMessage").firstChild.style.opacity = "0.5";
// let pic = document.getElementById("newMessage").children;
// for (var i = 0; i < pic.length; i++) {
//   console.log(i);
//   if (pic.length < 4) {
//     pic[i].style.backgroundColor = "#ffffff";
//   }
//   if (i < pic.length - 4) {
//     //   //通过索引获取对象
//     pic[i].style.backgroundColor = "#F9F9F9";
//     pic[i].style.opacity = "0.5";

//     console.log(pic[i]);
//   } else {
//     pic[i].style.backgroundColor = "#ffffff";
//   }
//   pic[i].style.borderRadius = "10px";
// }
